package ztc.thread;

import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import ztc.Constant;
import ztc.pattern.Tools;
import ztc.tools.Net;

import javax.tools.Tool;
import java.io.*;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

/**
 * Created by ztc on 16-5-31.
 */
public class IndexThread extends Thread {
    String path;

    public IndexThread() {
    }
    public IndexThread(String path){
        this.path=path;
    }

    @Override
    public void run() {
        HashMap map= Tools.patFenlei();
        Set<Map.Entry> set=map.entrySet();
        for(Map.Entry e:set) {
            File file=new File(path+"/"+e.getKey());
            if(!file.isDirectory()){
                file.mkdir();
            }
            new SecondThread(path+"/"+e.getKey(),e.getValue().toString()).start();
        }
    }
}
